import java.util.HashMap;
import java.util.Scanner;

/**
 * @author zhaoqian
 * @create 2021/9/3 21:25
 */
public class Main11111 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        StringBuilder builder = new StringBuilder();
        while (scanner.hasNext()) {
            String s = scanner.nextLine();
            HashMap<Object, Object> map = new HashMap<>();
            String[] split = s.split("@");
            String s1 = split[0].toString().replace(",","");

            String s2 = split[1].toString().replace(",","");
            for (int i =0 ; i<split[0].length();i=i+3){
                for (int j=0;j<split[1].length();j=j+3){
                    if (s1.charAt(i)==s2.charAt(i)){
                        map.put(s1.charAt(i),s1.charAt(i+2)-s2.charAt(i+2));
                    }



                }
            }


        }
    }
}
